/**
 * Copyright (c) 2006, PORTALIER Julien
 * 
 * Licensed under The LGPL License
 * Redistributions of files must retain the above copyright notice.
 * 
 * @package    Feather-CM
 * @subpackage Javascript
 * @copyright  Copyright (c) 2006, Julien PORTALIER
 * @link       http://portalier.com/feather
 * @license    http://www.opensource.org/licenses/lgpl-license.php The LGPL License
 */

_gettext_translation = [];

function _(txt)
{
	if (!_gettext_lang)
		var _gettext_lang = $E('html').getAttribute('lang');
	return (_gettext_translation[_gettext_lang] && _gettext_translation[_gettext_lang][txt]) ?
		_gettext_translation[_gettext_lang][txt] : txt;
}

function _gettext_add_translations(lang, translations)
{
	if (!_gettext_translation[lang])
		_gettext_translation[lang] = [];
	for (i in translations)
		_gettext_translation[lang][i] = translations[i];
}